<!--
  ~ The MIT License (MIT)
  ~
  ~ Copyright (c) 2019 ‭‭‭‭‭‭‭‭‭‭‭‭[smallbun] www.smallbun.org
  ~
  ~ Permission is hereby granted, free of charge, to any person obtaining a copy of
  ~ this software and associated documentation files (the "Software"), to deal in
  ~ the Software without restriction, including without limitation the rights to
  ~ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  ~ the Software, and to permit persons to whom the Software is furnished to do so,
  ~ subject to the following conditions:
  ~
  ~ The above copyright notice and this permission notice shall be included in all
  ~ copies or substantial portions of the Software.
  ~
  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  ~ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  ~ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  ~ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  ~ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  -->

<!DOCTYPE html>
<!--suppress ALL-->
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <div th:include="fragments/include  :: header('服务器信息')"></div>
</head>
<body class="list-body">
<div class="i-ibox">
    <div class="ibox-content" style="background-color: #f0f2f5">
        <div class="row">
            <div class="col-md-12 box">
                <div class="col-md-6 ">
                    <div class="box-header with-border">
                        <h2 class="box-title" style="font-weight: 500">CPU</h2>
                    </div>
                    <div class="box-body no-padding">
                        <table class="table">
                            <tbody>
                            <tr>
                                <th>属性</th>
                                <th style="width:40px">值</th>
                            </tr>
                            <tr>
                                <td>核心数</td>
                                <td th:text="${server.cpu.cpuNum}">0个</td>
                            </tr>
                            <tr>
                                <td>用户使用率</td>
                                <td th:text="${server.cpu.used + '%'}">0%</td>
                            </tr>
                            <tr>
                                <td>系统使用率</td>
                                <td th:text="${server.cpu.sys + '%'}">0%</td>
                            </tr>
                            <tr>
                                <td>当前空闲率</td>
                                <td th:text="${server.cpu.free + '%'}">0%</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="col-md-6 ">
                    <div class="box-header with-border">
                        <h2 class="box-title" style="font-weight: 500">内存</h2>
                    </div>
                    <div class="box-body no-padding">
                        <table class="table">
                            <tbody>
                            <tr>
                                <th>内存</th>
                                <th>属性</th>
                                <th style="width:40px">JVM</th>
                            </tr>
                            <tr>
                                <td>总内存</td>
                                <td th:text="${server.mem.total + 'G'}">0GB</td>
                                <td th:text="${server.jvm.total + 'M'}">0MB</td>
                            </tr>
                            <tr>
                                <td>已用内存</td>
                                <td th:text="${server.mem.used + 'G'}">0GB</td>
                                <td th:text="${server.jvm.used + 'M'}">0MB</td>
                            </tr>
                            <tr>
                                <td>剩余内存</td>
                                <td th:text="${server.mem.free + 'G'}">0GB</td>
                                <td th:text="${server.jvm.free + 'M'}">0MB</td>
                            </tr>
                            <tr>
                                <td>使用率</td>
                                <td th:class="${server.mem.usage gt 80} ? 'text-danger'">[[${server.mem.usage}]]%</td>
                                <td th:class="${server.jvm.usage gt 80} ? 'text-danger'">[[${server.jvm.usage}]]%</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <br>
            <div class="col-md-12 box">
                <div class="box-header with-border">
                    <h2 class="box-title" style="font-weight: 500">服务器信息</h2>
                </div>
                <div class="box-body no-padding">
                    <table class="table">
                        <tbody>
                        <tr>
                            <td>服务器名称</td>
                            <td th:text="${server.sys.computerName}">SMALLBUN</td>
                            <td>操作系统</td>
                            <td th:text="${server.sys.osName}">Linux</td>
                        </tr>
                        <tr>
                            <td>服务器IP</td>
                            <td th:text="${server.sys.computerIp}">127.0.0.1</td>
                            <td>系统架构</td>
                            <td th:text="${server.sys.osArch}">amd64</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <br>
            <div class="col-md-12 box">
                <div class="box-header with-border">
                    <h2 class="box-title" style="font-weight: 500">Java虚拟机信息</h2>
                </div>
                <div class="box-body no-padding">
                    <table class="table">
                        <tbody>
                        <tr>
                            <td>Java名称</td>
                            <td th:text="${server.jvm.name}">Java</td>
                            <td>Java版本</td>
                            <td th:text="${server.jvm.version}">1.8.0</td>
                        </tr>
                        <tr>
                            <td>启动时间</td>
                            <td th:text="${server.jvm.startTime}">2019-01-01 00:00:00</td>
                            <td>运行时长</td>
                            <td th:text="${server.jvm.runTime}">0天0时0分0秒</td>
                        </tr>
                        <tr>
                            <td colspan="1">安装路径</td>
                            <td colspan="3" th:text="${server.jvm.home}"></td>
                        </tr>
                        <tr>
                            <td colspan="1">项目路径</td>
                            <td colspan="3" th:text="${server.sys.userDir}"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <br>
            <div class="col-md-12 box">
                <div class="box-header with-border">
                    <h2 class="box-title" style="font-weight: 500">磁盘状态</h2>
                </div>
                <div class="box-body no-padding">
                    <table class="table">
                        <tbody>
                        <tr>
                            <th>盘符路径</th>
                            <th>文件系统</th>
                            <th>盘符类型</th>
                            <th>总大小</th>
                            <th>可用大小</th>
                            <th>已用大小</th>
                            <th>已用百分比</th>
                        </tr>
                        </tbody>
                        <tbody>
                        <tr th:each="sysFile : ${server.sysFiles}">
                            <td th:text="${sysFile.dirName}">C:\</td>
                            <td th:text="${sysFile.sysTypeName}">NTFS</td>
                            <td th:text="${sysFile.typeName}">local</td>
                            <td th:text="${sysFile.total}">0GB</td>
                            <td th:text="${sysFile.free}">0GB</td>
                            <td th:text="${sysFile.used}">0GB</td>
                            <td th:class="${sysFile.usage gt 80} ? 'text-danger'">[[${sysFile.usage}]]%</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>